import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签

perc = [62.13, 37.83]
x_label = ['男', '女']
colors = ['red', 'blue']
# labels 名称 colors：颜色，explode=分裂 autopct 显示百分比
paches, texts, autotexts = plt.pie(perc, labels=x_label, explode=(0, 0.03), colors=colors, autopct='%0.1f%%')
for autotext in autotexts:
    autotext.set_color('white')
for ta in texts + autotexts:
    ta.set_fontsize('20')
plt.show()
